package com.zhengtoudai.ui.presenter;

import com.zhengtoudai.http.HttpApi;
import com.zhengtoudai.injector.PerActivity;
import com.zhengtoudai.ui.bean.RedeemTransfer;
import com.zhengtoudai.ui.view.TransferDialogView;

import javax.inject.Inject;

import rx.functions.Action1;

/**
 * Created by Administrator on 2016/8/30 0030.
 */
@PerActivity
public class TransferDialogPresenterImpl extends BasePresenterImpl<TransferDialogView> implements TransferDialogPresenter {

    @Inject
    public TransferDialogPresenterImpl(){

    }
    @Override
    public void redeemTransfer(String etenderId) {
        mSubscription=HttpApi.getInstance().redeemTransfer(etenderId).
                subscribe(new Action1<RedeemTransfer>() {
                    @Override
                    public void call(RedeemTransfer transfer) {
                        mView.onResult(transfer);
                    }
                }, new Action1<Throwable>() {
                    @Override
                    public void call(Throwable throwable) {
                        mView.onFailure(throwable);
                    }
                });
    }
}
